El archivo .bashrc tiene que ir colocado en la carpeta del usuario %USERPROFILE%
#vars
cb="feature/173_GetGlobalStatistics"
#alias
alias ll="cat -n"
alias lb="git branch -a --sort=-committerdate"
alias gs="git status"
alias gl="git log"
alias cod="cd /c/Users/manuel.bascoy/code/"
alias ccod="cd /c/Users/manuel.bascoy/code/Projects/PostAcademy-Backend-Team2/"
alias lab="cd /c/Users/manuel.bascoy/lab/"
gc(){
git checkout $@
}
gcb(){
git checkout $cb
}
gd(){
git diff $1..$2 -- $3
}
cl(){
cat -n | awk -v re=$1 'NR==re {print $(NF-0)}'
}
f(){
find $2 -iname "*$1*"
}
lv(){
echo '$q: '$q
echo '$w: '$w
echo '$e: '$e
echo '$r: '$r
}
create(){
if [ -z $2 ];
then
echo "Use:";
echo "create java <app-name> <group-name>"
echo "create angular <name>"
echo "create spring <name> <package name>"
echo "create node <name>"
else
if [ $1 = 'java' ];
then
mvn archetype:generate -DgroupId=$3 -DartifactId=$2 -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion="1.4" -DinteractiveMode=false
elif [ $1 = 'angular' ];
then
ng new $2 --routing --style css;
elif [ $1 = 'spring' ];
then
echo "Go to: https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.6.4&packaging=jar&jvmVersion=17&groupId=$3&artifactId=$2&name=$2&description=$2%20project%20for%20Spring%20Boot&packageName=$3&dependencies=web";
elif [ $1 = 'node' ];
then
mkdir $2;
cd $2;
npm init -y;
npm install typescript --save-dev;
npm install @types/node --save-dev;
npx tsc --init --rootDir src --outDir build --esModuleInterop --resolveJsonModule --lib es6 --module commonjs --allowJs true --noImplicitAny true;
mkdir src;
echo
echo "Put code inside 'src/' folder and run 'npx tsc' the code will be build in 'build/' folder"
else
echo "Invalid project"
fi
fi
}
cmds(){
echo "--- Vars ---"
echo '$cb'": Current Branch"
echo
echo "--- commands ---"
echo "f: Find command"
echo "ll: List lines (pipe)"
echo "cl: Copy Line"
echo "lb: List branches ordered by date"
echo "lv: List vars"
echo "gs: Git Status"
echo "gl: Git Log"
echo "gc: Git Checkout"
echo "gcb: Git Checkout to current branch"
echo "gd: Git Diff"
echo "cod: Code Folder"
echo "lab: Lab Folder"
echo "ccod: Current Code Project"
}
bashrc | git bash | bash functions